package com.example.demo.web.common.interceptor;

import lombok.extern.slf4j.Slf4j;
import org.noear.solon.annotation.Component;
import org.noear.solon.core.handle.Context;
import org.noear.solon.core.handle.Handler;
import org.noear.solon.core.route.RouterInterceptor;
import org.noear.solon.core.route.RouterInterceptorChain;

/**
 * @author airhead
 */
@Slf4j
@Component
public class DemoRouteInterceptor implements RouterInterceptor {
  @Override
  public void doIntercept(Context ctx, Handler mainHandler, RouterInterceptorChain chain)
      throws Throwable {
    String path = ctx.path();
    log.info("2. DemoRouteInterceptor, path: {}", path);

    chain.doIntercept(ctx, mainHandler);
  }
}
